﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ExamsManager.ascx.cs" Inherits="Framework.Portal.Layouts.Admin.Components.BGTT.OnlineExam.ExamsManager" %>
<%@ Register Assembly="System.Web.Extensions" Namespace="System.Web.UI" TagPrefix="asp" %>

<style>
    .content {border: solid 1px #fff;}
</style>
<table align="center" width="100%" cellspacing="1" cellpadding="0" border="0" class="content">
    <tr>
        <td class="header1" colspan="4" align="left">
            <asp:Label ID="lblCommandName" runat="server"></asp:Label>
        </td>
    </tr>
    <tr>
        <td colspan="4" class="header2" height="21">
            &nbsp;
        </td>
    </tr>
    <tr>
        <td class="postheader">
            <strong>Từ khóa</strong>
        </td>
        <td class="post">
            <asp:TextBox ID="txtkeysearch" runat="server" Width="100%"></asp:TextBox>
        </td>
        <td class="postheader" width="15%" align="left">
            <strong>Trạng thái</strong>
        </td>
        <td class="post" width="35%" align="left">
            <asp:DropDownList ID="drpContentStatus" runat="server">
            </asp:DropDownList>
        </td>
    </tr>
    <tr>
        <td class="postheader" width="15%" align="left">
            <strong>Từ ngày</strong>
        </td>
        <td class="post" width="35%" align="left">
            <asp:TextBox ID="txtFromDate" CssClass="inputDate" runat="server" Width="200px"></asp:TextBox>
        </td>
        <td class="postheader" width="15%" align="left">
            <strong>Đến ngày</strong>
        </td>
        <td class="post" width="35%" align="left">
            <asp:TextBox ID="txtToDate" CssClass="inputDate" runat="server" Width="200px"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td class="postfooter" colspan="4" valign="middle" align="center">
            <asp:Button ID="btnSearch" runat="server" Text="Tìm kiếm" CssClass="pbutton"  />
        </td>
    </tr>
</table>
<br />
<br />
<table width="100%" cellspacing="1" cellpadding="0" border="0" class="content">
    <tr>
        <td class="header2" align="center" width="3%">
            #
        </td>
        <td class="header2" align="center" width="5%">
            ID
        </td>
        <td class="header2" align="center" width="10%">
            Ảnh đại diện
        </td>
        <td class="header2" align="center" width="30%">
            Tên đề thi
        </td>
        <td class="header2" align="center" width="10%">
            Trạng thái
        </td>
        <td class="header2" align="center" width="10%">
            Ngày bắt đầu thi
        </td>
        <td class="header2" align="center" width="10%">
            Ngày kết thúc thi
        </td>
        <td class="header2" align="center" width="10%">
            Số câu hỏi
        </td>
        <td class="header2" align="center" width="10%">
            Chức năng
        </td>
    </tr>
    <asp:Repeater ID="rptDistributed" runat="server" OnItemDataBound="rptDistributed_ItemDataBound" OnItemCommand="rptDistributed_ItemCommand">
        <ItemTemplate>
            <tr>
                <td class="post" align="center">
                    <asp:CheckBox ID="chkCheckThis" runat="server" /><asp:HiddenField ID="lblKey" runat="server" />
                </td>
                <td class="post" align="center">
                    <asp:Label ID="lblID" runat="server"></asp:Label>
                </td>
                <td class="post" align="center">
                    <asp:Image ID="imgAvatar" runat="server" />
                </td>
                <td class="post" align="left">
                    <asp:Label ID="lblTitle" runat="server"></asp:Label>
                </td>
                <td class="post" align="center">
                    <asp:Label ID="lblStt" runat="server"></asp:Label>
                </td>
                <td class="post" align="center">
                    <asp:Label ID="lblStart" runat="server"></asp:Label>
                </td>
                <td class="post" align="center">
                    <asp:Label ID="lblEnd" runat="server"></asp:Label>
                </td>
                <td class="post" align="center">
                    <asp:Label ID="lblToTalQ" runat="server"></asp:Label>
                </td>
                <td class="post" align="center">
                    <NS:ImageButton LocalizedPage="IMAGEACTION" LocalizedTag="EDIT24" ID="btnImgManageProfile"
                        runat="server" CommandArgument='<%# Eval("ID") %>' CommandName="edit"
                        ToolTip="Sửa" />
                    <NS:ImageButton LocalizedPage="IMAGEACTION" LocalizedTag="UNPUBLISH24" ID="btnImgManagePassword" runat="server" CommandArgument='<%# Eval("ID") %>' CommandName="unpublish" ToolTip="Gỡ xuống" Visible="false" />
                    <NS:ImageButton LocalizedPage="IMAGEACTION" LocalizedTag="PUBLISH24" ID="ImageButton1" runat="server" CommandArgument='<%# Eval("ID") %>' CommandName="publish" ToolTip="Đăng lên" Visible="false" />
                    <asp:ImageButton ID="imgBtnAutoExam" runat="server" ImageUrl="/Templates/Admin/Resources/images/icon/system_upgrade.png" CommandArgument='<%# Eval("ID") %>' CommandName="auto" ToolTip="Thi tự động" Width="24" />
                    <NS:ImageButton LocalizedPage="IMAGEACTION" LocalizedTag="DELETE24" ID="ImageButton2" runat="server" CommandArgument='<%# Eval("ID") %>' CommandName="remove" ToolTip="Xóa" OnClientClick="return confirm('Bạn có chắc muốn xóa đề thi này khỏi hệ thống?');" />
                </td>
            </tr>
        </ItemTemplate>
        <AlternatingItemTemplate>
            <tr>
                <td class="postheader" align="center">
                    <asp:CheckBox ID="chkCheckThis" runat="server" /><asp:HiddenField ID="lblKey" runat="server" />
                </td>
                <td class="postheader" align="center">
                    <asp:Label ID="lblID" runat="server"></asp:Label>
                </td>
                <td class="postheader" align="center">
                    <asp:Image ID="imgAvatar" runat="server" />
                </td>
                <td class="postheader" align="left">
                    <asp:Label ID="lblTitle" runat="server"></asp:Label>
                </td>
                <td class="postheader" align="center">
                    <asp:Label ID="lblStt" runat="server"></asp:Label>
                </td>
                <td class="postheader" align="center">
                    <asp:Label ID="lblStart" runat="server"></asp:Label>
                </td>
                <td class="postheader" align="center">
                    <asp:Label ID="lblEnd" runat="server"></asp:Label>
                </td>
                <td class="postheader" align="center">
                    <asp:Label ID="lblToTalQ" runat="server"></asp:Label>
                </td>
                <td class="postheader" align="center">
                    <NS:ImageButton LocalizedPage="IMAGEACTION" LocalizedTag="EDIT24" ID="btnImgManageProfile"
                        runat="server" CommandArgument='<%# Eval("ID") %>' CommandName="edit"
                        ToolTip="Sửa" />
                    <NS:ImageButton LocalizedPage="IMAGEACTION" LocalizedTag="UNPUBLISH24" ID="btnImgManagePassword" runat="server" CommandArgument='<%# Eval("ID") %>' CommandName="unpublish" ToolTip="Gỡ xuống" Visible="false" />
                    <NS:ImageButton LocalizedPage="IMAGEACTION" LocalizedTag="PUBLISH24" ID="ImageButton1" runat="server" CommandArgument='<%# Eval("ID") %>' CommandName="publish" ToolTip="Đăng lên" Visible="false" />
                    <asp:ImageButton ID="imgBtnAutoExam" runat="server" ImageUrl="/Templates/Admin/Resources/images/icon/system_upgrade.png" CommandArgument='<%# Eval("ID") %>' CommandName="auto" ToolTip="Thi tự động" Width="24" />
                    <NS:ImageButton LocalizedPage="IMAGEACTION" LocalizedTag="DELETE24" ID="ImageButton2" runat="server" CommandArgument='<%# Eval("ID") %>' CommandName="remove" ToolTip="Xóa" OnClientClick="return confirm('Bạn có chắc muốn xóa đề thi này khỏi hệ thống?');" />
                </td>
            </tr>
        </AlternatingItemTemplate>
    </asp:Repeater>
    <tr>
        <td class="postfooter" colspan="9" valign="middle" align="left" height="25">
            <asp:Button ID="Button1" runat="server" Text="Cập nhật" CssClass="pbutton" />
            &nbsp;
            <asp:Button ID="Button2" runat="server" Text="Xóa" CssClass="pbutton" />
            &nbsp;
            <input type="button" value="Thêm mới" class="pbutton" onclick="window.location.href='/Default.aspx?p=3&l=1&m=335&t=1&a=0';" />
            &nbsp;
            <asp:Label ID="lblUpdateStatus" runat="server" Font-Bold="True" ForeColor="Blue"></asp:Label>
            
            </td>
    </tr>
</table>
<script type="text/javascript">
    $('#<%= txtFromDate.ClientID %>').DatePicker({
        format: 'd/m/Y',
        date: $('#<%= txtFromDate.ClientID %>').val(),
        current: $('#<%= txtFromDate.ClientID %>').val(),
        starts: 1,
        position: 'right',
        onBeforeShow: function () {
            $('#<%= txtFromDate.ClientID %>').DatePickerSetDate($('#<%= txtFromDate.ClientID %>').val(), true);
        },
        onChange: function (formated, dates) {
            $('#<%= txtFromDate.ClientID %>').val(formated);
            //$('#inputDate').DatePickerHide();
        }
    });
    $('#<%= txtToDate.ClientID %>').DatePicker({
        format: 'd/m/Y',
        date: $('#<%= txtToDate.ClientID %>').val(),
        current: $('#<%= txtToDate.ClientID %>').val(),
        starts: 1,
        position: 'right',
        onBeforeShow: function () {
            $('#<%= txtToDate.ClientID %>').DatePickerSetDate($('#<%= txtToDate.ClientID %>').val(), true);
        },
        onChange: function (formated, dates) {
            $('#<%= txtToDate.ClientID %>').val(formated);
            //$('#inputDate').DatePickerHide();
        }
    });		
    
</script>
